<template>
  <div class="home">
    <!-- 左侧菜单栏 -->
    <TypeNav />
    <!-- 轮播图 or 右侧 -->
    <ListContainer />
    <!-- 今日推荐 -->
    <TodayRecommend />
    <!-- 商品热卖排行 -->
    <Rank />
    <!-- 猜你喜欢 -->
    <Like />
    <!-- 家用电器 -->
    <Floor v-for="floor in floorList" :key="floor.id" :list="floor" />
    <!-- 商标 -->
    <Brand />
  </div>
</template>

<script>
import { mapState } from "vuex";
// @ is an alias to /src
import ListContainer from "@/components/home/listContainer/ListContainer";
import TodayRecommend from "@/components/home/todayRecommend/TodayRecommend";
import Rank from "@/components/home/rank/Rank";
import Like from "@/components/home/like/Like";
import Floor from "@/components/home/floor/Floor";
import Brand from "@/components/home/brand/Brand";
export default {
  name: "Home",
  components: {
    ListContainer,
    TodayRecommend,
    Rank,
    Like,
    Floor,
    Brand,
  },
  mounted() {
    this.$store.dispatch("getFloorList")
    // //获取用户信息
    // this.$store.dispatch('getUserInfo')
  },
  computed: {
    ...mapState({
      floorList: (state) => state.home.floorList,
    }),
  },
};
</script>
